<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			if(Array.prototype.add===undefined){
				Array.prototype.add=function(){
					var sum=0;
					for(var i=0;i<this.length;i++){
						sum+=this[i];
					}
					return sum;
				}
			}
			
			var arr=[1,2,3,4,5];
			console.log(arr.add());
		</script>
	</body>
</html>
